<script setup>
import { ref, defineOptions } from 'vue'
import { currentHots } from '@/api/getAxios_2.ts'

const newbooks = ref([])
let pageNo = ref('1')
currentHots('8211', pageNo.value).then((res) => {
    // console.log(res);
    newbooks.value = res.data.data.list
})

</script>
<template>
    <div class="box" >
        <TopTitle :flag="true" name="新书速递"></TopTitle>
        <div class="city-msg">
            <ul class="total">
                <li v-for="item in newbooks" @click="$router.push(`/BookInfo?storyId=${item.storyId}`)">
                    <div class="coverImg">
                        <img :src="item.story.smallCover" alt="">
                    </div>
                    <div class="msg">
                        <p class="name">{{ item.story.name }}</p>
                        <p class="detail">{{ item.story.introduce }}</p>
                        <p class="type">
                            <span class="author-type">{{ item.story.author }} | {{ item.story.type }}</span>
                            <span class="fireValue">{{ (item.story.fireValue / 10000).toFixed(1) + '万人气值' }}</span>
                        </p>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</template>

<style scoped lang='less'>
.box {
    height: 100vh;
    overflow: scroll;

    &::-webkit-scrollbar {
        display: none;
    }
}

.city-msg {
    // height: 158vw;
    background-color: #fff;
    margin-bottom: 15px;

    ul {
        display: flex;
        flex-direction: column;
        background-color: #fff;

        li {
            padding: 10px;
            height: 40vw;
            display: flex;

            .coverImg {

                border-radius: 10px;
                width: 30vw;
                height: 40vw;

                img {
                    border-radius: 10px;
                    box-shadow: 0px 15px 7px -11px rgba(0, 0, 0, .3);

                    width: 100%;
                    height: 100%;
                }
            }

            .msg {
                text-align: left;
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                width: 68vw;
                margin-left: 10px;

                .name {
                    font-size: 18px;

                }

                .detail {
                    display: -webkit-box;
                    text-align: center;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    color: #939296;
                    font-size: 14px;
                    text-align: left;
                }

                .type {

                    color: #939296;
                    font-size: 12px;

                    .fireValue {
                        margin-left: 20px;
                        color: #ccae59;
                    }
                }


            }

        }
    }
}
</style>